#ifndef __usart_driver_H_
#define __usart_driver_H_

typedef enum
{
	COM_USART1=0,
	COM_USART2,
	COM_USART3,
	COM_UART4,
	COM_UART5,
	COM_UART6,
	COM_UART7,
	COM_UART8,
	COM_MAX,
}E_COM;

enum
{
	OPTIONAL_NULL=0,
	OPTIONAL_CTS,
	OPTIONAL_RS485,
	OPTIONAL_DMA,
};



#define COM_BR_9600		9600
#define COM_BR_38400	38400
#define COM_BR_115200	115200
#define COM_BR_1500000	1500000





void com_usart_init(E_COM index,u32 BaudRate,u8 optional);
void com_usart_uninit(E_COM index);
u16 com_send_data(E_COM index,const u8 * buff, u16 size);
struct FIFO_S * com_rx_fifo_get(E_COM index);
struct FIFO_S * com_tx_fifo_get(E_COM index);






/********************************usart DMA *******************************************/
u8 com_dma_usart_init(E_COM index,u32 BaudRate,u8 optional);
void com_dma_usart_uninit(E_COM index);
u16 com_dma_send_data(E_COM index,const u8 * buff, u16 size);
struct FIFO_S * com_dma_rx_fifo_get(E_COM index);
struct FIFO_S * com_dma_tx_fifo_get(E_COM index);




#endif
